<%--
  Created by IntelliJ IDEA.
  User: Aaking-aline
  Date: 2022-05-09
  Time: 10:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册页</title>
</head>
<body>
    <center>
        <form action="RegisterServlet" method="post" id="form1">
            注册账号: <input type="text" name="username"> <br>  <%--input标签的name属性是用来设置发送到后台时 键值对的键名  值是你在输入框里输入的内容--%>
            注册密码: <input type="password" name="password" id="mima1"> <br>
            确认密码: <input type="password" id="mima2"> <br>
            <input type="button" value="注册" onclick="func()">
        </form>
    </center>

    <script>
        function func(){
        	let mima1 = document.getElementById("mima1");
        	let mima2 = document.getElementById("mima2");

        	if(mima1.value == mima2.value){
        		let form1 = document.getElementById("form1");
                form1.submit();
                return ;
            }

        	alert("两次密码不一致,请重新输入!");
        }
    </script>

</body>
</html>
